﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL;
using Model;
using System.Data;
using System.Data.SqlClient;
using Word = Microsoft.Office.Interop.Word;
using System.IO;
using System.Reflection;
using System.Windows.Forms;

namespace NCRE学生考试端V1._0
{
    public class WordAQuestionFlag 
    {
        
        private readonly WordQuestionEntityBll wordquestionbll = new WordQuestionEntityBll();
        private readonly WordQuestionEntity wordinfo = new WordQuestionEntity();
        //定义一个ExamConfigBll类
        readonly ExamConfigBll examconfigbll = new ExamConfigBll();

        #region 获取字段中questionflag中的参数-程金鹏-2018年4月17日11:17:26
        /// <summary>
        /// 获取字段中QuestionFlag中的参数-程金鹏-2018年4月17日11:17:26
        /// </summary>
        /// <param name="flag">包裹参数的特殊标志符号</param>
        /// <returns=>返回参数的内容</returns>
        private string GetQuestionFlag_Parameter(string QuestionPara, char flag)
        {


            //#段落ID
            //*截取字符的位置
            //%截取字符串的长度
            //^表格ID
            //&表格X轴
            //<表格Y轴
            //>照片ID
            //?选择页眉脚ID
            //.题型类别
            //,

            string[] a = QuestionPara.Split(flag);
            string b = string.Concat(a[1]);
            return string.Concat(a[1]);
        }


        #endregion

        #region 判断是什么类型的题 程金鹏-2018年4月17日15:34:51
        /// <summary>
        /// 判断是什么类型的题 程金鹏-2018年4月17日15:34:51
        /// </summary>
        /// <param name="wordinfo"></param>
        public void SwitchQuestionFlag(WordQuestionEntity wordinfo, DataTable dt)
        {
            WordAPageOperate wordpage = new WordAPageOperate();
            System.Threading.Thread.Sleep(300);
            WordAFindKeyWord wordfindkeyword = new WordAFindKeyWord();
            System.Threading.Thread.Sleep(300);
            WordAFontInstall wordfontinstall = new WordAFontInstall();
            System.Threading.Thread.Sleep(300);
            WordACreateTable wordtable = new WordACreateTable();
            System.Threading.Thread.Sleep(300);


            //判断是否动态建库成功
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                //下面的dt表示按照试卷类型在数据库中加载word的题目信息，在frmjudge.cs对dt进行赋

                string questionflag = dt.Rows[i]["QuestionFlag"].ToString().Trim();
                string QuestionPara = dt.Rows[i]["QuestionParameter"].ToString().Trim();


                String collegeId = MyInfo.MycollegeID();
                //判断是否学生记录表存在
                if (examconfigbll.IsTableExist("WordQuestionRecordEntity_" + collegeId) == false)
                {
                    break;
                }
                else
                {
                    int Para_Pargraphs = 0;// //获取段落参数,两个#号之间为段落参数
                    int Para_StringStartIndex = 0;// //获取字符串开始位置，两个*之间是字符串开始位置信息。
                    int Para_StringLength = 0;//获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                    int Para_PictureID = 0;//照片ID，两个>之间的是照片ID参数
                    int Para_FormID = 0;//表格ID，两个^之间的是表格ID参数
                    int Para_QuadrantX = 0;//获取表格X轴的参数，两个&之间的是X轴参数
                    int Para_QuadrantY = 0;//获取表格Y轴的参数，两个<之间的是X轴参数
                    int Para_HeaderFooterID = 0;//选择页眉页脚ID，两个？之间是页眉页脚ID





                    //成功了就开始判分
                    //读取字符串
                    switch (questionflag)//获得题类型并进行swith判断
                    {
                        case "插入空行":
                            //获取段落参数,两个#号之间为段落参数
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            //得到一个答题记录的实体
                            wordfindkeyword.FindKeyWord(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "查找替换":
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindReplaceWord(wordinfo, dt, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "标题字体型号":
                            //获取段落参数,两个#号之间为段落参数
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //得到一个答题记录的实体
                            wordfontinstall.FontNameInstall(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "标题字体颜色":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontColorInstall(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "标题字体大小":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontSizeInstall(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "标题字体加粗":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontBoldInstall(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "标题字体对齐方式":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontAlignInstall(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "标题字符间距":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontSeparationInstall(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "页边距上下":
                            wordpage.PageMarginUpOperate(wordinfo, dt);
                            break;

                        case "页边距左右":

                            wordpage.PageMarginLeftOperate(wordinfo, dt);
                            break;
                        case "装订线位置":
                            wordpage.GutterPosition(wordinfo, dt);
                            break;
                        case "纸张方向":
                            wordpage.PageDirection(wordinfo, dt);
                            break;
                        case "纸张大小":
                            wordpage.PageSize(wordinfo, dt);
                            break;

                        case "查找页码":
                            wordpage.FindPageNum(wordinfo, dt);
                            break;

                        case "查找图片":
                            wordpage.FindPicture(wordinfo, dt);
                            break;
                        case "图片高度":
                            Para_PictureID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '>'));
                            wordpage.PictureWidth(wordinfo, dt, Para_PictureID);
                            break;
                        case "正文字体型号":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.MainTextSet(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "正文字体大小":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.MainTextSizeSet(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "正文格式":

                            wordfontinstall.MainTextFormatSet(wordinfo, dt);
                            break;

                        case "正文行距":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.SpacingFormatSet(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "表格行高":
                            //获取表格ID
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            //获取X轴表格第X列
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            //
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetLineHeight(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;
                        case "表格列宽":
                            //获取表格ID
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            //获取X轴表格第X列
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            //
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetColWeight(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;

                        //++++++++++++++++buduide++++++++++++++++++++
                        case "合并单元格文字":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordtable.SetFirstColFont(wordinfo, dt, Para_FormID, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "表格外边框线":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.FormBorderFont(wordinfo, dt, Para_FormID);
                            break;
                        case "表格内边框线":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.FormInBorderFont(wordinfo, dt, Para_FormID);
                            break;
                        case "表格边框线颜色":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.FormInBorderColorFont(wordinfo, dt, Para_FormID);
                            break;

                        case "表格底纹":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetColShading(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;
                        case "表格格式":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableWordFormatA(wordinfo, dt, Para_FormID);
                            break;
                        case "表格文字格式":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.TableWordFormat(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;
                        case "单行表格字体型号":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetOneRowFontName(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);

                            break;

                        case "单行表格字体大小":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetOneRowFontSize(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);

                            break;
                        case "表格文字型号":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetFontName(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);

                            break;
                        case "表格文字大小":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetFontSize(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);

                            break;
                        case "表格文字加粗":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            wordtable.SetFontBold(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);

                            break;

                        case "标题字体间距":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontSpaceInstallB(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "删除空格":
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfontinstall.DeleteBlankWordC(wordinfo, dt, Para_StringStartIndex, Para_StringLength);
                            break;

                        case "替换段落":
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.ReplaceParagraphWordC(wordinfo, dt, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "替换文字":
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindKeyWordC(wordinfo, dt, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "页边距":

                            wordpage.PageMarginUpOperateH(wordinfo, dt);
                            break;

                        case "页眉页脚边距":
                            wordpage.PageMarginTopOperate(wordinfo, dt);
                            break;

                        case "标题格式":
                            wordfontinstall.FontAlignInstallC(wordinfo, dt);
                            break;

                        case "小标题格式":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleFontAlignInstallC(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "小标题字体型号":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleFontNameInstallC(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "小标题字体颜色":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleFontColorInstallC(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "小标题字体大小":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleFontSizeInstallC(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "小标题字体加粗":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleFontBoldInstallC(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "小标题段前段后":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.TittleAlignSetC(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "页眉文字":
                            Para_HeaderFooterID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '?'));
                            wordpage.HeaderTextSetC(wordinfo, dt, Para_HeaderFooterID);
                            break;

                        case "页眉字体型号":
                            Para_HeaderFooterID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '?'));
                            wordpage.HeaderTextTypeSetC(wordinfo, dt, Para_HeaderFooterID);
                            break;
                        case "页眉字体大小":
                            Para_HeaderFooterID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '?'));
                            wordpage.HeaderTextSizeSetC(wordinfo, dt, Para_HeaderFooterID);
                            break;
                        case "页眉字体格式":

                            wordpage.HeaderTextFormatSetC(wordinfo, dt);
                            break;

                        case "图片宽高":
                            Para_PictureID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '>'));
                            wordfontinstall.FindPictureHightC(wordinfo, dt, Para_PictureID);
                            break;

                        case "表格内边框线颜色":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableBoldBolderInColorE(wordinfo, dt, Para_FormID);
                            break;

                        case "查找表格内容":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.FindFormTextC(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;


                        case "正文字体加粗":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.MainTextBoldSetB(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "查找括号":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindChinesebracketsE(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "查找空格":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindSearchSpacesE(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;
                        case "查找空行":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindLineE(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;

                        case "标题文字底纹":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.TiTleCaptionShadingE(wordinfo, dt, Para_Pargraphs);
                            break;
                        case "标题段前段后":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.FontParagraphInstallE(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "小标题字体格式":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.LittleRightIndentSetE(wordinfo, dt, Para_Pargraphs);
                            break;



                        case "页眉格式":
                            Para_HeaderFooterID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '?'));
                            wordpage.PageHeaderFormatE(wordinfo, dt, Para_HeaderFooterID);
                            break;

                        case "表格文字":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordtable.TableWordFormatH(wordinfo, dt, Para_FormID, Para_StringStartIndex, Para_StringLength);
                            break;


                        //++++++++++++++++buduide++++++++++++++++++++
                        case "表格外边框线颜色":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableBoldBolderOutColorE(wordinfo, dt, Para_FormID);
                            break;

                        case "表格单行填充颜色":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableSingelInColorE(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;


                        case "插入图片":

                            wordfindkeyword.FindPictureF(wordinfo, dt);
                            break;
                        case "图片宽度":
                            Para_PictureID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '>'));
                            wordfindkeyword.FindPictureWidthF(wordinfo, dt, Para_PictureID);
                            break;

                        case "正文字体格式":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            wordfontinstall.MainTextFormatSetF(wordinfo, dt, Para_Pargraphs);
                            break;

                        case "页码格式":
                            Para_HeaderFooterID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '?'));
                            wordpage.SearchPageF(wordinfo, dt, Para_HeaderFooterID);
                            break;


                        case "表格外边框":
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableBoldBolderF(wordinfo, dt, Para_FormID);
                            break;

                        case "查找文字":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindFontShapeH(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;

                        case "查找字体":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindFontShapeG(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;

                        case "标题字体格式":
                            wordfontinstall.FontAlignInstallB(wordinfo, dt);
                            break;

                        case "表格单行字体颜色":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableSingleSizeColorG(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;

                        case "表格字体颜色":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableLineSizeColorG(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;

                        case "查找标点":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfindkeyword.FindPunctuationH(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;


                        case "标题文字":
                            Para_Pargraphs = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '#'));
                            //获取字符串开始位置，两个*之间是字符串开始位置信息。
                            Para_StringStartIndex = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '*'));
                            //获取字符串截取长度，两个%之间是将要截取字符串的长度参数
                            Para_StringLength = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '%'));
                            wordfontinstall.TiTleFontH(wordinfo, dt, Para_Pargraphs, Para_StringStartIndex, Para_StringLength);
                            break;


                        case "表格单行底纹":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableSingleShadingH(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;
                        case "表格单行文字颜色":
                            Para_QuadrantX = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '&'));
                            Para_QuadrantY = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '<'));
                            Para_FormID = Convert.ToInt32(GetQuestionFlag_Parameter(QuestionPara, '^'));
                            wordtable.TableLineSizeColorH(wordinfo, dt, Para_FormID, Para_QuadrantX, Para_QuadrantY);
                            break;

                        default:
                            break;
                    }
                    //更新list，插入记录
                }
            }
        }
        #endregion
    }
}



